import { Session } from "@/utils/storage";

export const userHook: any = reactive({
    roleFlag: false,
    roleList: computed(() => Session.get('userInfo')?.roleList ?? []),
    userDatas: null,
    userData: computed(() => (userHook.userDatas || Session.get('userInfo')) ?? null),
    roles: computed(() => Session.get('userInfo')?.roleList?.map((p: any) => p.roleKey) ?? []),//获取当前角色
})